package org.eden.heartbeat.core.persistence;

import org.eden.heartbeat.api.model.Request;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

/**
 * The DAO interface for status requests sent to remote machines.
 *
 * @author trsimoes
 * @version $Revision:$
 */
public interface RequestDAO extends AbstractDAO {

    /**
     * Inserts a status request into the database.
     *
     * @param request the request to be inserted.
     * @throws SQLException thrown when an error occurs while inserting the request into the database.
     */
    public void insert(Request request) throws SQLException;

    /**
     * Gets a list of status request for a given remote machine in a specific period of time.
     *
     * @param host the remote machine host.
     * @param port the remote machine port.
     * @param startDate the start date.
     * @param endDate the end date.
     * @return list of status requests.
     * @throws SQLException throw when error occurs while accessing the database.
     */
    public List<Request> findRequestBetweenDates(String host, int port, Date startDate, Date endDate) throws SQLException;
}